#ifndef GEO_ENTITY_PRIVATE_H
#define GEO_ENTITY_PRIVATE_H
#include "GeoEntity.h"

class GeoEntityPrivate
{
public:
    GeoEntityPrivate(GeoEntity* target):
	    entity(target)
	{
		geo = new GeoTransform();
		pat = new osg::PositionAttitudeTransform();
		geo->setTerrain(mapNode->getTerrain());
		geo->addChild(pat);
	}	
	
    GeoPoint position;	
	double heading = 0.0;
	double pitch = 0.0;
	double roll = 0.0;
	double scale = 1.0;
	
	osgEarth::GeoTransform* geo = nullptr;
    osg::PositionAttitudeTransform* pat = nullptr;
private:
    const GeoEntity* entity = nullptr;	
};

#endif

SpatialReference::get("wgs84")

        GeoPoint pos(
            srs,
            uiLon->getValue(), uiLat->getValue(), uiAlt->getValue(),
            ALTMODE_ABSOLUTE);

        geo->setPosition( pos );

        osg::Quat ori =
            osg::Quat(osg::DegreesToRadians(roll),osg::Vec3(0,1,0))*
            osg::Quat(osg::DegreesToRadians(pitch),osg::Vec3(1,0,0))*
            osg::Quat(osg::DegreesToRadians(heading),osg::Vec3(0,0,-1));

        pat->setAttitude(ori);
		
		
    app.srs = mapNode->getMapSRS();
    app.geo = new GeoTransform();
    app.geo->setTerrain( mapNode->getTerrain() );
    app.pat = new osg::PositionAttitudeTransform();
    app.pat->addChild( model );
    app.geo->addChild( app.pat );

    root->addChild( app.geo );		